package com.bwie.remote;

import com.bwie.common.pojo.dto.UserDto;
import com.bwie.common.pojo.po.UserPo;
import com.bwie.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("bwie-system")
public interface AuthRemoteService {
    /**
     * 登录
     * @param userDto
     * @return
     */
    @PostMapping("/user/login")
    Result<UserPo> login(@RequestBody UserDto userDto);

    /**
     * 获取角色id
     * @param userId 用户id
     * @return 角色id列表
     */
    @GetMapping("/user/byUserIdGetRoleIdList/{userId}")
    Result<List<Integer>> getRoleId(@PathVariable("userId") Integer userId);
    @PostMapping("/user/register")
    void register(UserDto userDto);
    @PostMapping("/user/newLogin")
    UserPo newLogin(UserDto userDto);
}
